package com.my.apis.article;

import com.my.apis.article.fallback.IArticleClientFallback;
import com.my.model.article.dtos.ArticleDto;
import com.my.model.article.pojos.ApArticle;
import com.my.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient(value = "headlines-article",fallback = IArticleClientFallback.class)
public interface IArticleClient {

    /**
     * 保存文章至App端
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/article/save")
    ResponseResult saveArticle(@RequestBody ArticleDto dto) ;

    @DeleteMapping("/api/v1/article/delete/{id}")
    ResponseResult deleteArticle(@PathVariable Long id);

    /**
     * 根据id获取文章
     * @param id
     * @return
     */
    @GetMapping("/api/v1/article/getById/{id}")
    ApArticle getById(@PathVariable Long id);
}